#ifndef YCCOREIDGENERATOR_H
#define YCCOREIDGENERATOR_H

namespace yc {

class IdGenerator
{
public:
    static void init(int id) { id_ = id; }
    static void adjust(int id)
    {
        if (id_ >= id) {
            id_ = id - 1;
        }
    }
    static int next() { return --id_; }

private:
    static int id_;
};
} // namespace yc

#endif // YCCOREIDGENERATOR_H
